package com.firefightingiot.firefightingiot.config.exception;

import com.firefightingiot.firefightingiot.support.model.RespEntity;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 统一异常处理
 */
@ControllerAdvice
public class ExceptionHandle {
    @ExceptionHandler(value = Exception.class)
    @ResponseBody
    public RespEntity handle(Exception e) {
        e.printStackTrace();
        return RespEntity.fail();
    }
}
